Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fractal-noise

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fractal-noise

Fractal noise library

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Fractal Noise

Fractal noise functions designed to be used with any noise generation algorithm.

  • Deno module: https://deno.land/x/fractal_noise
  • NPM package: fractal-noise

Examples

These images were all generated using basic value noise with width: 888 and height: 111.

makeCylinderSurface(width, height, valueNoise3D, { frequency: 0.04, octaves: 2 })

Low frequency, double octave cylinder

makeCylinderSurface(width, height, valueNoise3D, { frequency: 0.06, octaves: 8 })

Medium frequency, high octave cylinder

makeLine(width, valueNoise1D) // (Replicated across y-axis)

Default line

makeLine(height, valueNoise1D, { frequency: 0.1 }) // (Replicated across x-axis)

High frequency line

makeRectangle(width, height, valueNoise2D)

Default rectangle

makeRectangle(width, height, valueNoise2D, { frequency: 0.04, octaves: 8 })

Low frequency, high octave rectangle

API

interface Options { amplitude?; frequency?; octaves?; persistence? }
  • amplitude?: number – Defaults to 1.0
  • frequency?: number – Defaults to 1.0
  • octaves?: number – Defaults to 1
  • persistence?: number – Defaults to 0.5
makeCuboid(width, height, depth, noise3, options?): number[][]
  • width: number
  • height: number
  • depth: number
  • noise3: (x: number, y: number, z: number) => number
  • options?: Options = {}

Generates a three-dimensional noise field for a rectangular cuboid.

makeCylinderSurface(circumference, height, noise3, options?): number[][]
  • circumference: number
  • height: number
  • noise3: (x: number, y: number, z: number) => number
  • options?: Options = {}

Generates a two-dimensional noise field formed around a three-dimensional cylinder, such that it is continuous across the x-boundaries.

makeLine(length, noise1, options?): number[]
  • length: number
  • noise1: (x: number) => number
  • options?: Options = {}

Generates a one-dimensional noise field.

makeRectangle(width, height, noise2, options?): number[][]
  • width: number
  • height: number
  • noise2: (x: number, y: number) => number
  • options?: Options = {}

Generates a two-dimensional noise field isolated to width and height (non-continuous noise).

makeSphereSurface(circumference, options?): number[][]
  • circumference: number
  • noise3: (x: number, y: number, z: number) => number
  • options?: Options = {}

Generates a two-dimensional noise field formed on the surface of a three-dimensional sphere.

Keywords

FAQs

Package last updated on 19 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc